fix: use JSON output for server status parsing in run-mcp-server#13
Merged
Conversation
The grep/awk parsing of `thv list` text output was broken when
`inputs.name` was empty: `grep -E "server|"` matched every line
(including the header row), causing outputs to be literal column
headers ("URL", "PORT", "STATUS") and the readiness check to
always time out.
Switch to `thv list --format json` with jq for reliable structured
parsing. Also move ${{ }} expressions into env: blocks to prevent
script injection.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
grep -E "server|"(empty regex alternative wheninputs.nameis unset) matched every line including the header row, causing outputs to be literal column headers (URL: URL,Port: PORT) and the readiness check to always time out after 30s.grep/awktext parsing withthv list --format json | jqfor reliable field extraction.${{ }}expressions fromrun:blocks intoenv:mappings to prevent script injection in the affected steps.Discovered via stacklok/brood-box#69 CI failure: https://github.com/stacklok/brood-box/actions/runs/23282849605/job/67699830961
Test plan
thv list --format json+jqcorrectly extractsname,status,url,port🤖 Generated with Claude Code